package com.xin.di.uav.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xin.di.uav.user.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author LTQ
 * @since 2023-04-03
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    /**
     * 保存用戶
     *
     * @param
     * @return
     */
    String saveUser(User user);


    /**
     * 检查是否存在user_id字段
     *
     * @param tableName
     * @return
     */
    @Select("SELECT 1 FROM information_schema.columns WHERE  table_name = #{tableName} AND column_name = 'user_id'")
    Integer checkIsExistColumnUserId(String tableName);
}
